Skip to content

[two_dimensional_scrollables] trailing pinned row/col for TableView#11519

Merged
auto-submit[bot] merged 7 commits intoflutter:mainfrom
Piinks:b133238
Apr 29, 2026
Merged

[two_dimensional_scrollables] trailing pinned row/col for TableView#11519
auto-submit[bot] merged 7 commits intoflutter:mainfrom
Piinks:b133238

Conversation

@Piinks
Copy link
Copy Markdown
Contributor

@Piinks Piinks commented Apr 16, 2026

This PR implements the requested feature to allow pinning rows and columns to the trailing edges of the TableView (bottom and right in LTR). Previously, only leading pinning was supported.

This implementation allows for use cases such as a "delete" button pinned to the right of every row, or a summary footer pinned to the bottom of the table.

  • Added trailingPinnedRowCount and trailingPinnedColumnCount to TableView.builder, TableView.list, and their associated delegates (TableCellBuilderDelegate, TableCellListDelegate).
  • Updated RenderTableViewport to calculate and track extents for trailing pinned spans. The indices for these spans are calculated from the end of the specified rowCount or columnCount.
  • Extended layoutChildSequence in RenderTableViewport to handle all 9 regions of the resulting grid (intersections of leading-pinned, regular, and trailing-pinned rows/columns).
  • Updated the paint method to correctly clip and layer trailing pinned areas, ensuring they stay at the viewport edges and that regular content scrolls underneath them correctly.
  • Adjusted maxScrollExtent calculations to account for both leading and trailing pinned extents, ensuring the scrollable area is correctly sized.
  • Updated the table alignment logic to correctly position the entire table (including pinned areas) when it is smaller than the viewport.

Technical Details

  • Trailing pinned elements are logically positioned based on the viewport dimension minus their cumulative extent.
  • Merged cells are supported within trailing pinned areas, with safety assertions to ensure they do not span across pinned and unpinned boundaries.
  • The implementation maintains compatibility with existing leading pinning and supports various combinations of both.

Fixes flutter/flutter#133238
Design Doc

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@github-actions github-actions Bot added p: two_dimensional_scrollables Issues pertaining to the two_dimensional_scrollables package triage-framework Should be looked at in framework triage labels Apr 16, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Apr 28, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 28, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Apr 28, 2026
@Piinks Piinks changed the title WIP - trailing pinned row/col for TableView [two_dimensional_scrollables] trailing pinned row/col for TableView Apr 29, 2026
@Piinks Piinks marked this pull request as ready for review April 29, 2026 01:28
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for trailing pinned columns and rows in the TableView widget, including updates to the render viewport, delegates, and associated tests. The feedback identifies several issues with the layout and clipping logic where alignment offsets were either omitted or incorrectly applied, potentially leading to misaligned cells or incorrect clipping when the table is not top-left aligned within the viewport.

Comment thread packages/two_dimensional_scrollables/lib/src/table_view/table.dart
Comment thread packages/two_dimensional_scrollables/lib/src/table_view/table.dart
Comment thread packages/two_dimensional_scrollables/lib/src/table_view/table.dart
Comment thread packages/two_dimensional_scrollables/lib/src/table_view/table.dart
Comment thread packages/two_dimensional_scrollables/lib/src/table_view/table.dart
Comment thread packages/two_dimensional_scrollables/lib/src/table_view/table.dart
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 29, 2026
@Piinks Piinks added the CICD Run CI/CD label Apr 29, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 29, 2026
Copy link
Copy Markdown
Contributor

@AbdeMohlbi AbdeMohlbi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 29, 2026
@auto-submit auto-submit Bot merged commit 3b8c4cb into flutter:main Apr 29, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: two_dimensional_scrollables Issues pertaining to the two_dimensional_scrollables package triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[two_dimensional_scrollables] TableView: trailing pinned Columns/Rows

2 participants